package com.apex.auth;

import com.apex.shared.redis.utils.RedissonUtil;
import com.apex.shared.starter.core.Result;
import com.baomidou.lock.annotation.Lock4j;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
@Tag(name = "鉴权接口")
public class AuthController {

    @Resource
    private RedissonUtil redissonUtil;

    @Lock4j
    @Operation(summary = "用户登录")
    @GetMapping("/{userId}")
    public Result<String> getUserInfo(@PathVariable(name = "userId") Long userId) {
        redissonUtil.set("test", "1");
        return Result.success("1");
    }

}
